package com.tencent.smtt.sdk;

import android.content.Context;
import android.os.Build;
import com.tencent.smtt.utils.TbsLog;
import java.io.File;

/* loaded from: classes2.dex */
class aq extends Thread {
    final /* synthetic */ Context a;
    final /* synthetic */ Context b;
    final /* synthetic */ am c;

    /* JADX INFO: Access modifiers changed from: package-private */
    public aq(am amVar, Context context, Context context2) {
        this.c = amVar;
        this.a = context;
        this.b = context2;
    }

    @Override // java.lang.Thread, java.lang.Runnable
    public void run() {
        am amVar;
        Context context;
        File r;
        TbsLog.i("TbsInstaller", "TbsInstaller--quickDexOptForThirdPartyApp thread start");
        try {
            if (this.a == null) {
                r = new File(TbsShareManager.getHostCorePathAppDefined());
            } else {
                if (!TbsShareManager.isThirdPartyApp(this.b)) {
                    amVar = this.c;
                    context = this.a;
                } else if (TbsShareManager.c(this.b) == null || !TbsShareManager.c(this.b).contains("decouple")) {
                    amVar = this.c;
                    context = this.a;
                } else {
                    r = this.c.q(this.a);
                }
                r = amVar.r(context);
            }
            File r2 = this.c.r(this.b);
            int i = Build.VERSION.SDK_INT;
            if (i != 19 && i < 21) {
                com.tencent.smtt.utils.j.a(r, r2, new ar(this));
            }
            com.tencent.smtt.utils.j.a(r, r2, new as(this));
            TbsLog.i("TbsInstaller", "TbsInstaller--quickDexOptForThirdPartyApp thread done");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
